package com.akkainaction.helloactor.actorselection;

import akka.actor.ActorRef;
import akka.actor.ActorSelection;
import akka.actor.ActorSystem;
import akka.actor.Props;
import com.akkainaction.helloactor.actorselection.actor.TargetActor;

public class TestActorSelection {

    public static void main(String[] args) {
       ActorSystem system = ActorSystem.create("sys");
        ActorRef targetActor = system.actorOf(Props.create(TargetActor.class), "targetActor");
        ActorSelection actorSelection = system.actorSelection("/user/targetActor");
        actorSelection.tell("hello target", ActorRef.noSender());
    }
}
